load(
    "//tools/skylark:drake_cc.bzl",
    "drake_cc_googletest",
)
load("//tools/skylark:drake_data.bzl", "models_filegroup")
load("//tools/install:install_data.bzl", "install_data")
load("//tools/lint:lint.bzl", "add_lint_tests")
load("//tools/workspace/ros_xacro_internal:defs.bzl", "xacro_file")

package(default_visibility = ["//visibility:public"])

xacro_file(
    name = "homecart_bimanual.urdf",
    src = "homecart_bimanual.urdf.xacro",
)

xacro_file(
    name = "homecart_cutting_board.sdf",
    src = "homecart_cutting_board.sdf.xacro",
)

models_filegroup(
    name = "glob_models",
    extra_srcs = [
        "homecart_bimanual.urdf",
        "homecart_cutting_board.sdf",
        "homecart_grippers.dmd.yaml",
        "homecart_no_grippers.dmd.yaml",
        "homecart.dmd.yaml",
    ],
    visibility = ["//visibility:private"],
)

install_data(
    name = "install_data",
    data = [":glob_models"],
)

filegroup(
    name = "models",
    srcs = [
        ":glob_models",
        "@drake_models//:tri_homecart/homecart_arm_mount_cantilever.mtl",
        "@drake_models//:tri_homecart/homecart_arm_mount_cantilever.obj",
        "@drake_models//:tri_homecart/homecart_arm_mount_stack.mtl",
        "@drake_models//:tri_homecart/homecart_arm_mount_stack.obj",
        "@drake_models//:tri_homecart/homecart_basecart.mtl",
        "@drake_models//:tri_homecart/homecart_basecart.obj",
        "@drake_models//:tri_homecart/homecart_basecart_wood_color.png",
        "@drake_models//:tri_homecart/homecart_baseplate.mtl",
        "@drake_models//:tri_homecart/homecart_baseplate.obj",
        "@drake_models//:tri_homecart/homecart_bimanual_upper_structure.mtl",
        "@drake_models//:tri_homecart/homecart_bimanual_upper_structure.obj",
        "@drake_models//:tri_homecart/homecart_cutting_board.mtl",
        "@drake_models//:tri_homecart/homecart_cutting_board.obj",
        "@drake_models//:tri_homecart/homecart_cutting_board_color.png",
    ],
)

# === test/ ===

drake_cc_googletest(
    name = "parse_homecart_test",
    srcs = ["test/parse_homecart_test.cc"],
    data = [
        ":models",
        "//manipulation/models/ur3e:models",
        "//manipulation/models/wsg_50_description:models",
    ],
    deps = [
        "//common:find_resource",
        "//multibody/parsing",
    ],
)

add_lint_tests()
